{% extends 'cms/base.html'%}

{% block title %}发布新闻{% endblock %}

{% block head %}
{% endblock %}

{% block content-header %}
  <h1>发布新闻</h1>
{% endblock %} 

{% block content %}
  <div class="row">
    <div class="col-md-12">
      <div class="box box-primary">
        <form action="" class="form" method="post" enctype="multipart/form-data">
          {% csrf_token %}
          <div class="box-body">
            <div class="form-group">
              <label for="title-form">标题</label>
              <input type="text" id = 'title-form' class="form-control" name="title">
            </div>
            <div class="form-group">
              <label for="category-form">文章分类</label>
              <select name="category" id="category-form" class="form-control">
                {% for category in categories %}
                  <option value="{{category.pk}}">{{category.name}}</option>
                {% endfor %}
              </select>
            </div>
            <div class="form-group">
              <label for="desc-form">描述</label>
              <input type="text" name="desc" class="form-control" id="desc-form">
            </div>
            <div class="form-group">
              <label for="thumbnail-form">缩略图</label>
              <div class="input-group">
              <!-- <input type="text" class="form-control" id="thumbnail-form" name="thumbnail"> -->
                <input type="file" name="thumbnail">
              <!--  <span class="input-group-btn">
                  <button class="btn btn-default">上传图片</button>
              </span> -->
              </div>
            <div class="form-group">
              <label for="content-form">内容</label>
              <textarea name="content" id="content-form" cols="30" rows="10" class="form-control"></textarea>
              <!--<script id='editor' type ='text/plain'></script> -->
            </div>
          </div>
          <div class="box-footer">
            <button class="btn btn-primary pull-right">发布新闻</button>
          </div>
        </form>
      </div>
    </div>
  </div>
{% endblock %} 